package com.article.controller.test;

import com.article.utils.JedisUtil;
import redis.clients.jedis.Jedis;

/**
 * Created by Administrator on 2017/6/15.
 */
public class RedisJedis {
    public static void main(String[] args) {
        Jedis jedis = JedisUtil.getJedis();
        try {
            //System.out.println(jedis.del("lock"));;
            long i1 = jedis.setnx("lock", String.valueOf(System.currentTimeMillis()));
            System.out.println(i1);
            long i2 = jedis.setnx("lock", String.valueOf(System.currentTimeMillis()));
            System.out.println(i2);
            //jedis.del("lock");
        } finally {
            jedis.close();
        }
    }
}
